#include <stdio.h>
#include <string.h>
#include "utils.h"

void shellsort(unsigned char **words, int arraySize) {
	int p;
	for (p = arraySize / 2; p > 0; p = p == 2 ? 1 : (int) (p / 2)) {
		int i;
		for (i = p; i < arraySize; ++i) {
			unsigned char *tmp = words[i];
			int j;

			for (j = i; j >= p && comparar(tmp,words[j - p]) < 0; j -= p) {
				words[j] = words[j - p];
			}
			words[j] = tmp;
		}
	}
}
